package com.pn.controller;

import com.pn.entity.Auth;
import com.pn.entity.Result;
import com.pn.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author :LY
 * @Description :
 * @Date :2025/4/17 20:35
 */
@RequestMapping("/auth")
@RestController
public class AuthControll {

    //注入AuthService
    @Autowired
    private AuthService authService;

    //查询所有权限菜单树的url接口/auth/auth-tree
    @RequestMapping("auth-tree")
    public Result loadAllAuthTree(){
        //执行业务
        List<Auth> allAuthTree = authService.allAuthTree();
        //响应
        return Result.ok(allAuthTree);
    }
}
